package com.yunhe.common.model.data;

import com.fasterxml.jackson.annotation.JsonFormat;

import java.util.Date;


/**
 *  单个变压器效率对象定义
 * @author liuronglei
 * @date 2019/5/12 15:10:00
 */
public class TransformerEfficiency {
    private Long devCode;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date dtime;

    private Integer type;

    private Float value;

    private Double input;

    private Double output;

    public TransformerEfficiency() {
    }

    public TransformerEfficiency(Long devCode, Date dtime, Integer type, Float value, Double input, Double output) {
        this.devCode = devCode;
        this.dtime = dtime;
        this.type = type;
        if((value != null) ||  (value < 1f)) {
            this.value = value;
        } else {
            this.value = 1f;
        }
        this.input = input;
        this.output = output;
    }

    public Long getDevCode() {
        return devCode;
    }

    public void setDevCode(Long devCode) {
        this.devCode = devCode;
    }

    public Date getDtime() {
        return dtime;
    }

    public void setDtime(Date dtime) {
        this.dtime = dtime;
    }

    public Float getValue() {
        return value;
    }

    public void setValue(Float value) {
        this.value = value > 100.0f ? 100.0f : value;
    }

    public Double getInput() {
        return input;
    }

    public void setInput(Double input) {
        this.input = input;
    }

    public Double getOutput() {
        return output;
    }

    public void setOutput(Double output) {
        this.output = output;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    @Override
    public String toString() {
        return "TransformerEfficiency{" +
                "devCode=" + devCode +
                ", dtime=" + dtime +
                ", type=" + type +
                ", value=" + value +
                ", input=" + input +
                ", output=" + output +
                '}';
    }
}
